package com.yx.front.mapper;

import com.yx.front.model.BookCollect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 用户书本收藏表 Mapper 接口
 * </p>
 *
 * @author YangXiong
 * @since 2023-04-18
 */
public interface BookCollectMapper extends BaseMapper<BookCollect> {

    /**
     * @param userId 当前用户id
     * @param bookId 书本id
     * @return 收藏实体类
     */
    BookCollect getLogicOne(@Param("userId") Long userId, @Param("bookId") Long bookId);

    /**
     * @param userId 当前用户id
     * @param bookId 书本id
     * @return 是否操作成功
     */
    Boolean updateLogicDelete(@Param("userId") Long userId, @Param("bookId") Long bookId);
}
